package com.ifast.oupei.service.impl;

import java.io.IOException;
import java.text.ParseException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ifast.oupei.dao.OddsDao;
import com.ifast.oupei.domain.OddsDO;
import com.ifast.oupei.service.OddsService;
import com.ifast.oupei.util.HTMLParserUtil;
import com.ifast.oupei.vo.OddsTrack;
import com.ifast.common.base.CoreServiceImpl;

/**
 * 
 * <pre>
 * 比赛赔率信息表
 * </pre>
 * <small> 2018-04-23 12:22:35 | Aron</small>
 */
@Service
public class OddsServiceImpl extends CoreServiceImpl<OddsDao, OddsDO> implements OddsService {
	@Autowired
	OddsDao oddsDao;
	//根据比赛id获取赔率列表
  	public List<OddsDO> getOddsList(Integer id){
  		return oddsDao.getOddsList(id);
  	}
  	//获取变赔信息
	@Override
	public List<OddsTrack> getOddsTrack(Integer id, Integer companyId, String date) {
		try {
			return HTMLParserUtil.getOddsTrack(id, companyId, date);
		} catch (IOException | ParseException e) {
			e.printStackTrace();
			return null;
		}
	}
	@Override
	public List<OddsDO> deleteOddsList() {
		return oddsDao.deleteOddsList();
	}
	@Override
	public List<OddsDO> selectOddsList(Integer matchId, Integer companyId) {
		return oddsDao.selectOddsList(matchId, companyId);
	}
}
